package cn.com.sixboy.service.common.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.com.sixboy.dao.DataType;
import cn.com.sixboy.dao.QueryConditionEntity;
import cn.com.sixboy.entity.Shanghu;
import cn.com.sixboy.service.base.BaseServiceImplement;
import cn.com.sixboy.service.common.ShanghuAdminService;

/**
 * @author Sam.Zheng <zcl1866@sina.com>
 * @date 2013-5-1 19:02:46
 * @version <v0.1>
 * @copyright SixBoy
 */
@Service
public class ShanghuAdminServiceImpl extends BaseServiceImplement implements ShanghuAdminService {

	@Override
	public boolean addShanghu(Shanghu stu) {
		return super.add(stu);
	}

	@Override
	public List findAllShanghu() {
		return super.queryAllEntity("findAllShanghus", true);
	}

	@Override
	public List findAllShanghuByName(String name) {
		QueryConditionEntity cond = new QueryConditionEntity("findAllShanghusByName", "name", DataType.String, "%" + name + "%"); // 模糊匹配中间匹配查询
		return super.queryEntities(cond, true);
	}

	@Override
	public List findAllClassByName(String name) {
		QueryConditionEntity cond = new QueryConditionEntity("findAllClassesByName", "className", DataType.String, "%" + name + "%"); // 模糊匹配中间匹配查询
		return super.queryEntities(cond, true);
	}

}
